import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysUserGroupRelation = (params) => {
  params.head.transCode = 'querySysUserGroupRelation';
  return request({
    url: '/platform/sysUserGroupRelation/querySysUserGroupRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysUserGroupRelationListPage = (params) => {
  params.head.transCode = 'querySysUserGroupRelationListPage';
  return request({
    url: '/platform/sysUserGroupRelation/querySysUserGroupRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysUserGroupRelation = (params) => {
  params.head.transCode = 'saveSysUserGroupRelation';
  return request({
    url: '/platform/sysUserGroupRelation/saveSysUserGroupRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysUserGroupRelationList = (params) => {
  params.head.transCode = 'saveSysUserGroupRelationList';
  return request({
    url: '/platform/sysUserGroupRelation/saveSysUserGroupRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysUserGroupRelation = (params) => {
  params.head.transCode = 'saveOrUpdateSysUserGroupRelation';
  return request({
    url: '/platform/sysUserGroupRelation/saveOrUpdateSysUserGroupRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysUserGroupRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateSysUserGroupRelationList';
  return request({
    url: '/platform/sysUserGroupRelation/saveOrUpdateSysUserGroupRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysUserGroupRelation = (params) => {
  params.head.transCode = 'updateSysUserGroupRelation';
  return request({
    url: '/platform/sysUserGroupRelation/updateSysUserGroupRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysUserGroupRelation = (params) => {
  params.head.transCode = 'deleteSysUserGroupRelation';
  return request({
    url: '/platform/sysUserGroupRelation/deleteSysUserGroupRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysUserGroupRelationList = (params) => {
  params.head.transCode = 'deleteSysUserGroupRelationList';
  return request({
    url: '/platform/sysUserGroupRelation/deleteSysUserGroupRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysUserGroupRelationExcel = (params) => {
  downloadExcel({
    url: '/platform/sysUserGroupRelation/excelDownload/exportSysUserGroupRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
